class Controller(object):

   def __init__(self, view, model):
      m = self.model = model()
      v = self.view = view(self)
      m.beat.register(v.beat_callback)
      m.bpm.register(v.bpm_callback)
      v.mainloop()

   def start(self):
      self.model.start()

   def stop(self):
      self.model.stop()

   def delta_bpm(self, delta):
      model = self.model
      model.set_bpm(model.get_bpm()+delta)

   def set_bpm(self, bpm):
      self.model.set_bpm(bpm)
